package com.pig.graduate.service.impl.event;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pig.graduate.domain.event.EventEntry;
import com.pig.graduate.domain.produce.ProduceBoar;
import com.pig.graduate.result.MyResult;
import com.pig.graduate.service.event.EventEntryService;
import com.pig.graduate.mapper.event.EventEntryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 星星眼
* @description 针对表【event_entry】的数据库操作Service实现
* @createDate 2023-03-05 14:45:54
*/
@Service
public class EventEntryServiceImpl extends ServiceImpl<EventEntryMapper, EventEntry>
    implements EventEntryService{

    @Autowired
    private EventEntryMapper eventEntryMapper;


    @Override
    public MyResult entryList(EventEntry eventEntry) {
        PageHelper.startPage(eventEntry.getPageNum(), eventEntry.getPageSize());
        List<EventEntry> list = eventEntryMapper.entryList(eventEntry);
        for (EventEntry entry : list) {
            String location = entry.getBuildingsName() + "-" + entry.getColumnName();
            entry.setLocation(location);
        }
        PageInfo<EventEntry> pageInfo = new PageInfo<>(list);
        return  MyResult.success(pageInfo);
    }
}




